package com.ljt.common.config;

import com.alibaba.cloud.sentinel.annotation.SentinelRestTemplate;
import com.ljt.common.utils.exception.ExceptionUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author administrator
 * @date 2019/07/25
 * RestTemplate
 */
@Configuration
public class RestTemplateConfig {
	@Bean
	@SentinelRestTemplate(blockHandler = "handleException", blockHandlerClass = ExceptionUtil.class)
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}
}
